package com.parktech.sun.domain.repository.sunhz.hibernate;

import com.parktech.sun.domain.model.sunhz.Industry;
import com.parktech.sun.domain.model.sunhz.IndustryCategory;
import com.parktech.sun.domain.repository.hibernate.BaseRepositoryImpl;
import com.parktech.sun.domain.repository.sunhz.IndustryRepository;
import org.springframework.stereotype.Repository;

/**
 * User: Think
 * Date: 11-1-9
 * Time: 下午3:32
 */
@Repository("industryRepository")
public class IndustryRepositoryImpl extends BaseRepositoryImpl<Industry> implements IndustryRepository {

    public IndustryCategory getByCategoryId(Long categoryId) {
        return (IndustryCategory) getSession().get(IndustryCategory.class, categoryId);
    }

    public void saveOrUpdateCategory(IndustryCategory industryCategory) {
        getSession().saveOrUpdate(industryCategory);
    }
}
